from net.msg_handle import MsgHandle
from net import msg_class
import json


if __name__ == '__main__':
    # msg_str = '{"protoName": "MsgMove", "x": 100, "y": -20, "z": 0}'
    msg_str = '{"protoName": "MsgAttack", "x": 100, "y": -20, "z": 0}'
    MsgHandle().run(msg_str)

    # msg_handle = MsgHandle()

    # msg_dc = json.loads(msg_str)
    # proto_name = msg_dc.get('protoName')
    # assert hasattr(msg_handle, proto_name), f'`{proto_name}`在MsgHandle中没有对应的消息处理方案!'
    # method = getattr(msg_handle, proto_name)
    # method(msg_str)



